//
//  UIScrollView+ZRefresh.m
//  NewProject
//
//  Created by 陈洪鑫 on 2018/4/25.
//  Copyright © 2018年 chenIos. All rights reserved.
//

#import "UIScrollView+ZRefresh.h"
#import <MJRefresh.h>
@implementation UIScrollView (ZRefresh)
- (void)z_headerWithRefreshingTarget:(id)target refreshingAction:(SEL)selector
{
    self.mj_header = [MJRefreshNormalHeader headerWithRefreshingTarget:target refreshingAction:selector];
}
- (void)z_beginRefresh
{
    if (self.mj_header) {
        [self.mj_header beginRefreshing];
    }
}
- (void)z_endRefresh
{
    if (self.mj_header) {
        [self.mj_header endRefreshing];
    }

}
- (void)z_footerWithRefreshingTarget:(id)target refreshingAction:(SEL)selector
{
    self.mj_footer = [MJRefreshAutoNormalFooter footerWithRefreshingTarget:target refreshingAction:selector];
}

- (void)z_endFooterRefresh
{
    if (self.mj_footer) {
        [self.mj_footer endRefreshing];
    }
}
- (void)z_endNoMoreRefresh
{
    if (self.mj_footer) {
        [self.mj_footer endRefreshingWithNoMoreData];
    }
}
@end
